package com.example.config;

import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitmqConfig {

    @Value("${spring.rabbitmq.queue-name}")
    private String queueName;

    /**
     * 声明一个队列,名为 springBootHelloWorldQueue
     * @return
     */
    @Bean
    public Queue queue(){
        Queue queue = new Queue(queueName);
        return queue;
    }
}
